#ifndef EI_NET_MANAGER_H
#define EI_NET_MANAGER_H

#include "include/NetworkInterface.h"

using namespace Ogre;
namespace Ei {
class NetworkEvents;

//////////////////////////////////////////////////////////////////////	
class NetManager {
protected:
	
	NetworkInterface * mNetworkInterface; 
	WOscContainer* mRootContainer;
	std::string remote_ip;
	int mLocalPort;
	int mRemotePort;
	int maxMethods;
	int numMethods;
	
public:
	NetManager();
	~NetManager();
	// setup Osc space
	
	void AddNetworkMethod(String adress, void (NetworkEvents::*methodUsed)(const WOscMessage *));
	void SetupMethods();
	
	// process network interface
	void pollSocket(float dt);	
	void sendMessage(String message, bool parseInt = false);
	void sendSensor();	
	void send(WOscMessage& msg);
	struct in_addr getLocalIP() { return local_ip; } 
	
private:		
	struct in_addr local_ip;

};
} // namespace ei4

#endif
